﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace EyesOfTheDragon.Events
{
    public interface IDraw
    {
        void Draw(GameTime gt, SpriteBatch sp);
       
    }
    public class DrawList
    {
        
        public static DrawList Instance
        {
            get 
            {
                if (_instance == null)
                    _instance = new DrawList();
                return _instance;
            }
        }
        public void Draw(GameTime gt, SpriteBatch sp)
        {
            foreach (IDraw d in drawableObjects)
                d.Draw(gt, sp);
        }
        public void add(IDraw obj)
        {
            drawableObjects.Add(obj);
        }
        public void remove(IDraw obj)
        {
            drawableObjects.Remove(obj);
        }
        private List<IDraw> drawableObjects = new List<IDraw>();
        private static DrawList _instance;
    }
}
